#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;

int main()
{
	int n, m;
	cin >> n >> m;

	vector<vector<int>> v(m);
	for (int i = 0;i < m;i++){
		for (int j = 0;j < n;j++) {
			int tmp;
			cin >> tmp;
			v[i].push_back(tmp);
		}
	}
	for (int i = 0;i < m;i++) {
		for (int j = 0;j < n;j++) {
			cout << v[i][j] << endl;
		}
	}
	return 0;
}